function maxMin(arr) {
    let minCount = arr[0];
    let result = 0;
    for (let i = 0; i < arr.length; i++) {
        let cur = arr[i];
        let min = Math.min(first, minCount);
        let pre = cur - min;
        result = Math.max(pre, result);
    }
    return result;
}

maxMin([1, 5, 3, 6, 9, 4, 3])

function randomStr(n) {
    let str = "abcdefghijklmnopqrstuvwxyz0123456789";
    let result = '';
    for (let i = 0; i < n; i++) {
        result += str.charAt(Math.floor(Math.random() * str.length));
    }
    return result;
}

randomStr(5);